<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableRecipesIngredients extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up() {
        Schema::create('recipes_ingredients', function($table) {
            $table->integer('recipe_id');
            $table->integer('ingredient_id');
            $table->string('quantity', 40)->nullable(true);
            $table->primary(array('recipe_id', 'ingredient_id'));
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down() {
        Schema::drop('recipes_ingredients');
    }

}
